<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


    function calculateDayPrice($numOfDays, $car) {

        if(isset($numOfDays)){
            switch($numOfDays){
                case $numOfDays<=3:
                    return $car->day13price; /*'1-3 days: '.*/
                    break;
                case $numOfDays>=4 && $numOfDays<=7:
                    return $car->day47price; /*'4-7 days: '.*/
                    break;
                case $numOfDays>=8 && $numOfDays<=15:
                    return $car->day815price; /*'8-15 days: '.*/
                    break;
                case $numOfDays>=15:
                    return $car->dayfrom15price; /*'15+ days: '.*/
                    break;
            }
        }else{
            return $car->day13price;
        }
    }


?>